<template>
  <div :class="'logo-container-' + layout">
    <router-link to="/">
      <!-- 这里是logo变更的位置 -->
      <svg-icon v-if="logo" :icon-class="logo" class="logo"/>
      <span :class="{ 'hidden-xs-only': layout === 'horizontal' }" :title="title" class="title">
        {{ title }}
      </span>
    </router-link>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'

export default {
  name: 'VabLogo',
  data() {
    return {
      title: this.$baseTitle
    }
  },
  computed: {
    ...mapGetters({
      logo: 'settings/logo',
      layout: 'settings/layout'
    })
  }
}
</script>
<style lang="scss" scoped>
  @mixin container {
    position: relative;
    //height: $base-top-bar-height;
    overflow: hidden;
    //line-height: $base-top-bar-height;
  }

  @mixin logo {
    display: inline-block;
    width: 34px;
    height: 34px;
    margin-right: 10px;
    color: $base-title-color;
    vertical-align: middle;
  }

  @mixin title {
    display: inline-block;
    overflow: hidden;
    font-size: 20px;
    line-height: 55px;
    color: $base-title-color;
    font-weight: bold;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }

  .logo-container-vertical {
    @include container;
    text-align: left;
    .logo {
      @include logo;
    }

    .title {
      @include title;
      max-width: calc(#{$base-left-menu-width} - 60px);
    }
  }
</style>
